home *** CD-ROM | disk | FTP | other *** search
/ CICA 1995 August / CICA - The Ultimate Collection of Shareware for Windows (Disc 2) (August 1995).iso / disc2 / programr / atre27.exe / ATREE_27 / EXAMPLE4.LF < prev    next >
Text File  |  1992-08-01  |  3KB  |  95 lines

  1. #
  2. #
  3. #---- example4.lf
  4. #!!!! requires example3.lf to be run first !!!!
  5. #
  6. #
  7. #---- This is an lf example that learns the OR
  8. #---- function of two binary inputs by retraining trees
  9. #---- trained previously on the AND function.  Usually
  10. #---- one will not retrain trees to another function, but
  11. #---- instead to fine tune a tree's performance.
  12. #
  13.  
  14. #---- Specify tree statements.
  15. tree
  16.  
  17. #---- Train until we get 4 elements of the training set right
  18.     min correct  = 4
  19.  
  20. #---- or until 30 epochs have passed.
  21.     max epochs  = 30
  22.  
  23. #---- Load the trees from example3.tre
  24.     load tree from "example3.tre"
  25.  
  26. #---- Specify function statements.
  27. function
  28.  
  29. #---- Domain dimension MUST be the first statement, followed
  30. #---- by the codomain dimension statement.
  31.     domain dimension = 2
  32.  
  33. #---- There is only 1 codimension.
  34.     codomain dimension = 1
  35.  
  36. #---- Load encodings for use with example3.tre
  37.     load coding from "example3.cod"
  38.  
  39. #---- There are four rows in our training set.
  40. training set size = 4
  41. training set =
  42.  
  43. # A B   A or B
  44.   1 1     1
  45.   1 0     1
  46.   0 1     1
  47.   0 0     0
  48.  
  49. #---- We will test on the following 4 vectors.
  50. test set size = 4
  51. test set =
  52.  
  53. # A B   A or B
  54.   1 1     1
  55.   1 0     1
  56.   0 1     1
  57.   0 0     0
  58.  
  59.  
  60. #---- The following output file should be generated:
  61. #---- The first line indicates how many codomains there are.
  62. #---- The next four lines represent each of the four lines in the test set.
  63. #---- Each value is followed by its corresponding quantization number
  64. #---- in the prescribed encoding scheme.  Each codomain is followed
  65. #---- by the corresponding result from the ALN's, along with its quantization 
  66. #---- number.  Remember, it's not the calculated value that is as important
  67. #---- as the calculated quantization level.  You can get more accurate values
  68. #---- by tightening up the encoding.
  69.  
  70. #---- After the results is the error histogram, which counts, 
  71. #---- for each of the codomains, the number of times the result quantization 
  72. #---- level differed from the actual quantization level by n.  In this example,
  73. #---- the ALN's executed the test set perfectly, so there are 4 counts for
  74. #---- errors of n = 0 in the codomain.
  75.  
  76. #  A           B         A or B     A or B result
  77.  
  78. #1
  79. #1.000000 1 1.000000 1  1.000000 1  1.000000 1
  80. #1.000000 1 0.000000 0  1.000000 1  1.000000 1
  81. #0.000000 0 1.000000 1  1.000000 1  1.000000 1
  82. #0.000000 0 0.000000 0  0.000000 0  0.000000 0
  83. #
  84. #ERROR HISTOGRAM
  85. #0 errors       4
  86. #1 errors       0
  87. #2 errors       0
  88. #3 errors       0
  89. #4 errors       0
  90. #5 errors       0
  91. #6 errors       0
  92. #7 errors       0
  93. #8 errors       0
  94. #9+ errors      0
  95.